home *** CD-ROM | disk | FTP | other *** search
- CHESS
- (COMPUTE! Magazine September 1985 by John Krause)
-
- A computer chess game is great for those who can't always find a
- human opponent. But "CHESS" is more than just a substitute for a live
- player. You might call it a "chess processor." It processes chess
- positions as easily as a word processor manipulates text. It contains
- all the features a chess player could ever want. Its thinking routines
- are written entirely in machine language for greater speed, and they
- use basic principles of artificial intelligence to simulate an actual
- human chess player.
- CHESS consists of two programs. A BASIC program is used to create
- CHESS.BLD which contains the machine language. To play CHESS, make
- sure the CHESS.BLD file is on the disk with CHESS.BAS, then simply load
- and run CHESS.BAS.
- After running CHESS, you'll see a title screen for a few seconds
- while the computer prepares itself. Then the board is displayed with
- the pieces in their starting positions. You're in command of the white
- pieces versus the computer's black pieces on skill level 1, the easiest
- level. You should see a frame around the square in the lower-left
- corner of the board. This is the cursor which takes the place of your
- hand for moving and capturing pieces.
- Use the cursor keys to move the frame cursor atop the piece you
- wish to move. Press and release the Enter key. Now move the cursor to
- the square on which you want to place the piece and hit Enter again.
- Your piece moves to the new square, and the computer responds instantly
- with a countermove.
- One of the most valuable features of CHESS is that it checks for
- illegal moves. If you try to make an illegal move, the computer buzzes
- and keeps your piece on its square. This feature is not perfect,
- however. It won't catch illegal moves involving castling or en passant
- captures. But it will catch 99 percent of all illegal moves, including
- those that put your king in check, as well as the more obvious ones
- such as moving a pawn backwards. If the computer accepts your move,
- it's probably legal, but not necessarily so. If the computer rejects
- your move, however, you can be sure that it is illegal.
- If you're a beginner at chess, you'll find the move-checking
- feature especially valuable. Just by trying various moves and noting
- which ones the computer accepts, you can get a good idea of the way
- each piece can move.
- Information about the current game is displayed at the top of the
- screen. MOVE# indicates the number of the move currently being made,
- counting from the start of the game. In chess, a move by both sides is
- considered one move. So, the move number is changed only after both
- sides have moved.
- TO MORE indicates which side has the move. W means it is white's
- turn, and B means it is black's.
- Normally after you move, the computer automatically makes the
- next move. This can be turned off by pressing the T key to switch to
- two-player mode. Now you can play against another person with the
- computer acting as referee to check for illegal moves. To switch back
- to one-player mode, press T again.
- You can also let the computer make moves for you by pressing the
- M key. The side that the computer plays depends on whose turn it is.
- By repeatedly pressing M, you can watch the computer play itself.
- One of the advantages of a computer opponent over a human is that
- you can tell the computer exactly how hard you want it to try to beat
- you, and it obediently plays at that level of difficulty. This is
- important because it's no fun if you always love or always win
- effortlessly.
- LEVEL shows the current skill level from 1 to 5. You can change
- the level at any time by pressing keys 1-5. The difference between
- levels is the number of moves ahead that the computer looks. On level
- 1, for example, it looks ahead one full move or two half-moves (its
- move and your reply). Each succeeding level looks ahead one more
- half-move than the previous level.
- Alas, the smarter play on the higher levels doesn't come without
- a price. The further ahead the computer looks, the move moves it must
- examine and, hence, the longer it thinks. Here's a rundown of the
- five levels:
- Level 1: Beginner. Thinking time: one second. Look-ahead:
- two half-moves. Fast but dumb.
- Level 2: Intermediate. Thinking time: five seconds. Look-
- ahead: three half-moves. Provides a reasonable challenge for impatient
- players.
- Level 3: Tournament. Thinking time: two minutes. Look-
- ahead: four half-moves. Since the usual time limit for tournament play
- is 40 moves in two hours, an average of three minutes per move, this
- level is best suited for serious players.
- Level 4: Mate in two. Thinking time: 20 minutes. Look-
- ahead: five half-moves. Capable of solving most mate-in-two problems.
- Level 5: Postal chess. Thinking time: two hours. Look-
- ahead: six half-moves. Simulates chess by mail where there is no time
- limit. Can avoid checkmate in two moves.
- These thinking times are averages. The actual thinking time varies
- greatly depending on the position. For example, level 5 takes only five
- seconds with just two kings on the board. Also, these times are for the
- PC only. Since the PCjr runs at about two-thirds the speed of the PC,
- the thinking times for the PCjr are greater than the values shown above.
- It happens to everyone. It's inevitable. You've played for an
- hour, somehow managing to maneuver into a superior positions in what
- you consider to be the best game of your life, only to throw it all
- away in a single, spectacular blunder.
- Don't panic. You can take back the last half-move by pressing the
- B key. If you're in one-player mode, you need to press B again to take
- back your move and the computer's reply. In fact, you can press B
- repeatedly to take back several moves until you reach the starting
- position. This is possible because the computer records every move
- made in the game.
- Another use for this feature is to allow the computer to suggest
- a move for you. If you don't have a good idea of where to move next,
- press M and the computer will move for you. If you like that move,
- press M again to continue with the computer's next move. But if you
- think you've found a better move, press B to take back the suggested
- move and make your own move.
- Pressing the F key does the opposite of B. It moves forward
- through the move list up to the most advanced position. Note that
- every time a new move is made, the resulting position becomes the most
- advanced. So if you use B to backtrack to a previous position, and
- then make a new move, all subsequent stored moves are erased because
- they are no longer relevant.
- If you have a printer, you can print the move list by pressing the
- P key. The list appears in three columns: the move numbers, white's
- moves, and black's moves. Each move is indicated by the square the
- piece moved from followed by the square it moved to. Each square is
- specified by its coordinates according to the numbers along the left
- side of the board and the letters along the bottom.
- You can also dump the screen image to the printer to get a hardcopy
- of a particularly interesting position. Before loading BASIC from DOS,
- type GRAPHICS with the DOS master disk in the drive. Then run CHESS and
- press Shift-PrtSc (Fn-PrtSc on the PCjr) whenever you want to print the
- position.
- The computer thinks by analyzing thousands of possible moves and
- countermoves and choosing what it considers to be the best move based
- on the relative value of pieces. Most positions don't have just one
- best move but several which are equally good, in which case the computer
- chooses among them at random. This random factor insures that every
- game will be different, and makes for varied and interesting play.
- The computer announces checkmate when it occurs. However, there
- are a few quirks in the way the computer evaluates a checkmate. On
- levels 3-5, it announces checkmate prematurely. When this happens, the
- computer has determined that it's impossible to avoid checkmate on the
- next move or two -- assuming both sides make the best moves.
- Also, the computer doesn't know the subtle difference between
- checkmate and stalemate. Consequently, when a game is stalemated, the
- computer announces checkmate even though the game is a draw. Since the
- computer tries as hard as it can to checkmate its opponent, it also
- tries to achieve stalemate, possibly by forcing a draw when it could
- have won. Fortunately, this rarely happens, because a stalemate
- requires unusual circumstances, such as when one side has only the
- king remaining.
- You can start a new game at any time by pressing the N key. This
- sets up the pieces in the starting position with white on the bottom.
- If you want to play the black pieces, you can press the I key to invert
- the board, so you still play from the bottom. As with the N command,
- the board is reset to the starting position. However, the N and I
- commands retain the move list from the previous game. This allows you
- to replay the game using the F command. When replaying a game, be sure
- to reset the board by pressing I if the game was played in the inverted
- mode, or N if normal mode was used.
- You don't have to begin a game from the starting position. You can
- set up any position and begin playing from that point. If you want, you
- can first clear the board by pressing the C key. To add a piece or
- change a piece to a different one, move the cursor to the appropriate
- square, hold down either Shift or Ctrl, and press P, N, B, R, Q, or K
- for pawn, knight, bishop, rook, queen, or king, respectively. Holding
- down Shift adds one of the lower player's pieces, and Ctrl adds one of
- the upper player's pieces. (Just remember that Ctrl is above Shift on
- the keyboard.) A piece can be removed from the board by pressing the
- space bar. Note that these changes are not stored on the move list.
- These commands allow you to experiment with hypothetical or
- downright ridiculous positions. The position doesn't even have to be
- legal. Live out your fantasy by giving yourself ten queens versus the
- computer's lone king. Or invent your own type of chess by giving each
- side two kings, for example (although in this case the computer might
- get confused trying to determine a checkmate).
- You can also set up a problem for the computer to solve, such as
- the mate-in-two problems published in many newspapers. To solve a
- make-in-two problem, press C to clear the board, set up the position,
- press 4 to select level 4, and press M to start the computer thinking.
- After several minutes of deep thought, the computer will make a move
- (the solution) and announce checkmate. The only mate-in-two problems
- that the computer cannot solve are those which involve castling, en
- passant captures, or pawn promotion.
- The computer never castles or captures en passant because, due to
- their complexity, these moves are not included in its thinking routine.
- But you can make these special moves. To castle, move the king two
- squares to the left or right. The rook moves automatically. To capture
- en passant, move your pawn diagonally to the proper square. The
- opponent's pawn is removed automatically. Remember, the computer
- doesn't check for illegal moves involving castling or en passant
- captures, so if you're a beginner, you should familiarize yourself with
- the rules on these special moves.
- When a pawn reaches the opposite side of the board, it's
- automatically promoted to a queen. In the rare event that you would
- rather promote to a knight, bishop, or rook, you can easily make the
- change by positioning the cursor over the new queen and pressing N, B,
- or R with Shift or Ctrl. Note, however, that underpromotions are not
- stored in the move list.
- If you want to stop the present game and continue later, you can
- save the game on disk (in drive A) by pressing the S key. You'll see
- the prompt Save:. Type in a filename for your game and press Enter.
- The filename can be up to eight characters long. Don't type an
- extender; .CHS is added automatically. If a file on the disk already
- has the same name, it will be replaced.
- To load a previously saved game, press the L key. Answer the
- Load: prompt with the filename and press Enter. (Don't type the .CHS
- extender.) The L command restores the game exactly as it was when it
- was saved. Not only the position is restored, but also the move list
- and even the position of the cursor.
- If the computer is unable to save or load a game, an error number
- is displayed. See Appendix A of the BASIC Reference Manual for a
- description of the error.
- Besides allowing you to continue a game at a later time, the S and
- L commands can be used to create a library of your best games. To do
- this, press N or I just before saving. The game will come up in the
- starting position when loaded and can be replayed using the F command.
-
- CHESS Command Summary
- ---------------------
- B Move backward
- C Clear board
- F Move forward
- I New game (inverted)
- L Load game
- M Computer's move
- N New game
- P Print move list
- S Save game
- T Two players
- 1-5 Level
- Cursor Keys Move cursor
- Enter Your move
- Space Bar Remove piece
- Shift-P Lower player's pawn
- Shift-N Lower player's knight
- Shift-B Lower player's bishop
- Shift-R Lower player's rook
- Shift-Q Lower player's queen
- Shift-K Lower player's king
- Ctrl-P Upper player's pawn
- Ctrl-N Upper player's knight
- Ctrl-B Upper player's bishop
- Ctrl-R Upper player's rook
- Ctrl-Q Upper player's queen
- Ctrl-K Upper player's king
-